<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('admingroup_list'); ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>管理组管理 </title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<link href="templates/css/pagination.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/layindex.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" src="templates/js/forms.func.js"></script>
<script type="text/javascript">
function checkPagenum(id)
{	
var pn = document.getElementById(id).value; 
 location.href = "admingroup.php?checkPagenum="+pn;
}
</script>
</head>

<body class="mainbody">

<div class="aspNetHidden">
</div>
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <span>管理组管理</span>
  <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<!--/导航栏-->

<!--工具栏-->
<div id="floatHead" class="toolbar-wrap">
  <div class="toolbar">
    <div class="box-wrap">
      <a class="menu-btn"></a>
      <div class="l-list">
        <ul class="icon-list">
          <li><a class="add" href="admingroup_add.php"><i></i><span>新增</span></a></li>
        </ul>
      </div>
    </div>
  </div>
</div>
<!--/工具栏-->
<form method="post" action="" id="form1">
<!--列表-->
<div class="table-container">
  
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
    <tr>
      <th width="8%">ID</th>
      <th align="left">管理组名称</th>
      <th align="left" width="30%">管理组描述</th>
      <th align="left" width="15%">默认进入</th>
      <th width="15%">操作</th>
    </tr>
  
  <?php
	$sql = "SELECT * FROM `#@__admingroup`";
	if(!isset($checkPagenum)){$checkPagenum = $cfg_pagenum;}
	$dopage->GetPage($sql,$checkPagenum,'ASC');
	while($row = $dosql->GetArray())
	{

		//审核状态
		switch($row['checkinfo'])
		{
			case 'true':
				$checkinfo = '已审';
				break;  
			case 'false':
				$checkinfo = '未审';
				break;
			default:
				$checkinfo = '没有获取到参数';
		}
		//审核权限
		if($row['id'] == 1)
			$checkstr = '已审';
		elseif(IsModel('admingroup','Audit',1)==true)
			$checkstr = '<a href="admingroup_save.php?id='.$row['id'].'&action=check&checkinfo='.$row['checkinfo'].'&groupname='.$row['groupname'].'" title="点击进行审核与未审操">'.$checkinfo.'</a>';
		else
			$checkstr = $checkinfo;
		
		//修改权限
			if(IsModel('admingroup','update',1)==true)
				$updatestr = '<a href="admingroup_update.php?id='.$row['id'].'"">修改</a>';
			else
				$updatestr = '修改';
		
		//删除权限
		if($row['id'] == 1)
		$delstr = '删除';
		elseif(IsModel('admingroup','del',1)==true)	
		$delstr = '<a href="admingroup_save.php?action=del&id='.$row['id'].'&groupname='.$row['groupname'].'" onclick="return ConfDel(0);">删除</a>';
		else
			$delstr = '删除';
	?>
	<tr align="left" >
		<td align="center"><?php echo $row['id']; ?></td>
		<td><?php echo $row['groupname']; ?></td>
		<td><?php echo $row['description']; ?></td>
		<td><?php
		$r = $dosql->GetOne("SELECT `sitename` FROM `#@__site` WHERE `id`=".$row['groupsite']);
		echo $r['sitename'];
		?></td>
		<td align="center"><span><?php echo $checkstr; ?></span> | <span><?php echo $updatestr; ?></span> | <span ><?php echo $delstr; ?></span></td>
	</tr>
	<?php
	}
	?>
  </table>
  
</div>
<!--/列表-->

<!--内容底部-->
<div class="line20"></div>
<div class="pagelist">
  <div class="l-btns">
    <span>显示</span><input name="txtPageNum" type="text" value="<?php echo $checkPagenum;?>"  onblur="checkPagenum(this.id)"  onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="txtPageNum" class="pagenum" onkeydown="return checkNumber(event);" /><span>条/页</span>
  </div>
  <?php echo $dopage->GetList($sql,$checkPagenum); ?>

</div>
<!--/内容底部-->
</form>
</body>
</html>
